using UniversalAdminSystem.Domian.Core.ValueObjects;

namespace UniversalAdminSystem.Domian.Core.Events;

/// <summary>
/// 权限创建事件
/// </summary>
public class PermissionCreatedEvent : DomainEvent
{
    public PermissionId PermissionId { get; }
    public string PermissionCode { get; }

    public PermissionCreatedEvent(PermissionId permissionId, string permissionCode)
    {
        PermissionId = permissionId;
        PermissionCode = permissionCode;
    }
}

/// <summary>
/// 权限分配给角色事件
/// </summary>
public class PermissionAssignedToRoleEvent : DomainEvent
{
    public RoleId RoleId { get; }
    public PermissionId PermissionId { get; }

    public PermissionAssignedToRoleEvent(RoleId roleId, PermissionId permissionId)
    {
        RoleId = roleId;
        PermissionId = permissionId;
    }
}

/// <summary>
/// 权限从角色移除事件
/// </summary>
public class PermissionRemovedFromRoleEvent : DomainEvent
{
    public RoleId RoleId { get; }
    public PermissionId PermissionId { get; }

    public PermissionRemovedFromRoleEvent(RoleId roleId, PermissionId permissionId)
    {
        RoleId = roleId;
        PermissionId = permissionId;
    }
}

/// <summary>
/// 权限删除事件
/// </summary>
public class PermissionDeletedEvent : DomainEvent
{
    public PermissionId PermissionId { get; }
    public string PermissionCode { get; }

    public PermissionDeletedEvent(PermissionId permissionId, string permissionCode)
    {
        PermissionId = permissionId;
        PermissionCode = permissionCode;
    }
}

/// <summary>
/// 权限变更事件
/// </summary>
public class PermissionUpdatedEvent : DomainEvent
{
    public PermissionId PermissionId { get; }
    public string PermissionCode { get; }

    public PermissionUpdatedEvent(PermissionId permissionId, string permissionCode)
    {
        PermissionId = permissionId;
        PermissionCode = permissionCode;
    }
} 